package com.example.win.android_banduyujia.http.request;

import com.example.win.android_banduyujia.http.UrlContext;

import java.util.Map;

/**
 * Created by Win on 2015/10/12.
 */
public class ChangePasswordRequest extends BaseHttpRequest {
    public final static String URL = UrlContext.Url_ChangePaw.getContext();

    private String  id;
    private String  mOldpassword;
    private String  mNewpassword;
    private String  mAccessToken;

    public ChangePasswordRequest(String uid, String oldpwd, String newpwd, String access_token) {
         this.id = uid;
         this.mOldpassword = oldpwd;
         this.mNewpassword = newpwd;
         this.mAccessToken = access_token;
    }

    @Override
    protected String toRequestURL() {
        return URL;
    }

    @Override
    protected String toHttpMethod() {
        return HTTP_METHOD_POST;
    }

    @Override
    protected void toHttpRequestParams(Map<String, String> params) {
        params.put("id", id);
        params.put("old_pass",mOldpassword);
        params.put("new_pass",mNewpassword);
        params.put("new_pass_confirm", mAccessToken);
    }
}
